3.6.52 \(\int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^{\frac {3}{2}}(c+d x) \, dx\) [552]

Optimal. Leaf size=111 \[ -\frac {2 (a A-b B) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{d}+\frac {2 (A b+a B) \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{d}+\frac {2 a A \sqrt {\sec (c+d x)} \sin (c+d x)}{d} \]

[Out]

2*a*A*sin(d*x+c)*sec(d*x+c)^(1/2)/d-2*(A*a-B*b)*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticE(sin(
1/2*d*x+1/2*c),2^(1/2))*cos(d*x+c)^(1/2)*sec(d*x+c)^(1/2)/d+2*(A*b+B*a)*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d
*x+1/2*c)*EllipticF(sin(1/2*d*x+1/2*c),2^(1/2))*cos(d*x+c)^(1/2)*sec(d*x+c)^(1/2)/d

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {3039, 4082, 3872, 3856, 2719, 2720} \begin {gather*} \frac {2 (a B+A b) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}-\frac {2 (a A-b B) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 a A \sin (c+d x) \sqrt {\sec (c+d x)}}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Cos[c + d*x])*(A + B*Cos[c + d*x])*Sec[c + d*x]^(3/2),x]

[Out]

(-2*(a*A - b*B)*Sqrt[Cos[c + d*x]]*EllipticE[(c + d*x)/2, 2]*Sqrt[Sec[c + d*x]])/d + (2*(A*b + a*B)*Sqrt[Cos[c
 + d*x]]*EllipticF[(c + d*x)/2, 2]*Sqrt[Sec[c + d*x]])/d + (2*a*A*Sqrt[Sec[c + d*x]]*Sin[c + d*x])/d

Rule 2719

Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ[{
c, d}, x]

Rule 2720

Int[1/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticF[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ
[{c, d}, x]

Rule 3039

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*sin[(e_.
) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[g^(m + n), Int[(g*Csc[e + f*x])^(p - m - n)*(b + a*Csc[e + f*x])^m*(
d + c*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[p] && I
ntegerQ[m] && IntegerQ[n]

Rule 3856

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Dist[(b*Csc[c + d*x])^n*Sin[c + d*x]^n, Int[1/Sin[c + d
*x]^n, x], x] /; FreeQ[{b, c, d}, x] && EqQ[n^2, 1/4]

Rule 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rule 4082

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.
) + (A_)), x_Symbol] :> Simp[(-b)*B*Cot[e + f*x]*((d*Csc[e + f*x])^n/(f*(n + 1))), x] + Dist[1/(n + 1), Int[(d
*Csc[e + f*x])^n*Simp[A*a*(n + 1) + B*b*n + (A*b + B*a)*(n + 1)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e,
 f, A, B}, x] && NeQ[A*b - a*B, 0] &&  !LeQ[n, -1]

Rubi steps

\begin {align*} \int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^{\frac {3}{2}}(c+d x) \, dx &=\int \frac {(b+a \sec (c+d x)) (B+A \sec (c+d x))}{\sqrt {\sec (c+d x)}} \, dx\\ &=\frac {2 a A \sqrt {\sec (c+d x)} \sin (c+d x)}{d}+2 \int \frac {\frac {1}{2} (-a A+b B)+\frac {1}{2} (A b+a B) \sec (c+d x)}{\sqrt {\sec (c+d x)}} \, dx\\ &=\frac {2 a A \sqrt {\sec (c+d x)} \sin (c+d x)}{d}+(A b+a B) \int \sqrt {\sec (c+d x)} \, dx+(-a A+b B) \int \frac {1}{\sqrt {\sec (c+d x)}} \, dx\\ &=\frac {2 a A \sqrt {\sec (c+d x)} \sin (c+d x)}{d}+\left ((A b+a B) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx+\left ((-a A+b B) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx\\ &=-\frac {2 (a A-b B) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{d}+\frac {2 (A b+a B) \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{d}+\frac {2 a A \sqrt {\sec (c+d x)} \sin (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.30, size = 85, normalized size = 0.77 \begin {gather*} \frac {2 \sqrt {\sec (c+d x)} \left (-\left ((a A-b B) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )\right )+(A b+a B) \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right )+a A \sin (c+d x)\right )}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Cos[c + d*x])*(A + B*Cos[c + d*x])*Sec[c + d*x]^(3/2),x]

[Out]

(2*Sqrt[Sec[c + d*x]]*(-((a*A - b*B)*Sqrt[Cos[c + d*x]]*EllipticE[(c + d*x)/2, 2]) + (A*b + a*B)*Sqrt[Cos[c +
d*x]]*EllipticF[(c + d*x)/2, 2] + a*A*Sin[c + d*x]))/d

________________________________________________________________________________________

Maple [A]
time = 0.39, size = 246, normalized size = 2.22

method result size
default \(\frac {4 A \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -2 A \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, b -2 A \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, a -2 B \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, a +2 B \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, b}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) \(246\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*cos(d*x+c))*(A+B*cos(d*x+c))*sec(d*x+c)^(3/2),x,method=_RETURNVERBOSE)

[Out]

2*(2*A*cos(1/2*d*x+1/2*c)*sin(1/2*d*x+1/2*c)^2*a-A*EllipticF(cos(1/2*d*x+1/2*c),2^(1/2))*(sin(1/2*d*x+1/2*c)^2
)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*b-A*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))*(sin(1/2*d*x+1/2*c)^2)^(1/2
)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*a-B*EllipticF(cos(1/2*d*x+1/2*c),2^(1/2))*(sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*s
in(1/2*d*x+1/2*c)^2-1)^(1/2)*a+B*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))*(sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*sin(1/2
*d*x+1/2*c)^2-1)^(1/2)*b)/sin(1/2*d*x+1/2*c)/(2*cos(1/2*d*x+1/2*c)^2-1)^(1/2)/d

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c))*sec(d*x+c)^(3/2),x, algorithm="maxima")

[Out]

integrate((B*cos(d*x + c) + A)*(b*cos(d*x + c) + a)*sec(d*x + c)^(3/2), x)

________________________________________________________________________________________

Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order 4.
time = 0.10, size = 153, normalized size = 1.38 \begin {gather*} \frac {\frac {2 \, A a \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}} + \sqrt {2} {\left (-i \, B a - i \, A b\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + \sqrt {2} {\left (i \, B a + i \, A b\right )} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + \sqrt {2} {\left (-i \, A a + i \, B b\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) + \sqrt {2} {\left (i \, A a - i \, B b\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c))*sec(d*x+c)^(3/2),x, algorithm="fricas")

[Out]

(2*A*a*sin(d*x + c)/sqrt(cos(d*x + c)) + sqrt(2)*(-I*B*a - I*A*b)*weierstrassPInverse(-4, 0, cos(d*x + c) + I*
sin(d*x + c)) + sqrt(2)*(I*B*a + I*A*b)*weierstrassPInverse(-4, 0, cos(d*x + c) - I*sin(d*x + c)) + sqrt(2)*(-
I*A*a + I*B*b)*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(d*x + c) + I*sin(d*x + c))) + sqrt(2)*(I*
A*a - I*B*b)*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(d*x + c) - I*sin(d*x + c))))/d

________________________________________________________________________________________

Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c))*sec(d*x+c)**(3/2),x)

[Out]

Exception raised: SystemError >> excessive stack use: stack is 3005 deep

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))*(A+B*cos(d*x+c))*sec(d*x+c)^(3/2),x, algorithm="giac")

[Out]

integrate((B*cos(d*x + c) + A)*(b*cos(d*x + c) + a)*sec(d*x + c)^(3/2), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \left (A+B\,\cos \left (c+d\,x\right )\right )\,{\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^{3/2}\,\left (a+b\,\cos \left (c+d\,x\right )\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*cos(c + d*x))*(1/cos(c + d*x))^(3/2)*(a + b*cos(c + d*x)),x)

[Out]

int((A + B*cos(c + d*x))*(1/cos(c + d*x))^(3/2)*(a + b*cos(c + d*x)), x)

________________________________________________________________________________________